package com.jie.controller;


import com.jie.dto.CombinationTopicDTO;
import com.jie.response.RespBean;
import com.jie.service.ICombinationTopicService;
import com.jie.vo.CombinationDeleteVideoVO;
import com.jie.vo.CombinationTopicVO;
import com.jie.vo.ConditionVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.models.auth.In;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;


/**
 * <p>
 * 锻炼视频组合专题 前端控制器
 * </p>
 *
 * @author jie
 * @since 2024-04-21
 */
@RestController
@RequestMapping("/combination-topic")
@Api(tags = "短链视频组合专题模块")
public class CombinationTopicController {
    //根据id查看短视频组合
    @Autowired
    private ICombinationTopicService iCombinationTopicService;

    @ApiOperation("根据id查看短视频组合")
    @GetMapping("/get/combination/{topicId}")
    public RespBean<?> getCombinationById(@PathVariable("topicId") Integer topicId){
        CombinationTopicDTO res=iCombinationTopicService.getCombinationById(topicId);
        return RespBean.success("获取短视频资料",res);
    }
    @ApiOperation("添加短视频组合")
    @PostMapping("/add/combinationInfo")
    public RespBean<?> addCombination(@RequestBody CombinationTopicVO combinationTopicVO){
        Boolean flag=iCombinationTopicService.addCombinationInfo(combinationTopicVO);
        return RespBean.success("添加短视频资料",flag);
    }
    @ApiOperation("修改或删除短视频组合 未完成")
    @PutMapping("/updateOrDelete/combinationInfo")
    public  RespBean<?> updateOrDeleteCombinationInfo(@RequestBody CombinationTopicVO combinationTopicVO){
        return  RespBean.success("修改短视频资料",iCombinationTopicService.updateOrDeleteCombinationInfo(combinationTopicVO));
    }
    @ApiOperation("删除短视频组合")
    @DeleteMapping("/delete/combination/{topicId}")
    public RespBean<?> deleteCombination(@PathVariable("topicId") Integer topicId){
        return RespBean.success("删除短视频资料",iCombinationTopicService.deleteCombinationById(topicId));
    }
    @ApiOperation("分页获取运动专题模块")
    @GetMapping("/get/CombinationPage")
    public RespBean<?> getCombinationPage(ConditionVO conditionVO){
        return RespBean.success("分页获取运动专题模块",iCombinationTopicService.getCombinationPage(conditionVO));
    }


}

